import 'package:lcapp/data/jy_address_entity.dart';

jyAddressEntityFromJson(JyAddressEntity data, Map<String, dynamic> json) {
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['province'] != null) {
		data.province = json['province'].toString();
	}
	if (json['city'] != null) {
		data.city = json['city'].toString();
	}
	if (json['region'] != null) {
		data.region = json['region'].toString();
	}
	if (json['detailAddress'] != null) {
		data.detailAddress = json['detailAddress'].toString();
	}
	if (json['longitude'] != null) {
		data.longitude = json['longitude'].toString();
	}
	if (json['latitude'] != null) {
		data.latitude = json['latitude'].toString();
	}
	if (json['isDefault'] != null) {
		data.isDefault = json['isDefault'].toString();
	}
	if (json['adCode'] != null) {
		data.adCode = json['adCode'].toString();
	}
	if (json['currentAddressId'] != null) {
		data.currentAddressId = json['currentAddressId'].toString();
	}
	return data;
}

Map<String, dynamic> jyAddressEntityToJson(JyAddressEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['createTime'] = entity.createTime;
	data['id'] = entity.id;
	data['province'] = entity.province;
	data['city'] = entity.city;
	data['region'] = entity.region;
	data['detailAddress'] = entity.detailAddress;
	data['longitude'] = entity.longitude;
	data['latitude'] = entity.latitude;
	data['isDefault'] = entity.isDefault;
	data['adCode'] = entity.adCode;
	data['currentAddressId'] = entity.currentAddressId;
	return data;
}